package com.yljk.imdoctor.utils;

import com.yljk.imdoctor.entity.ConversationBean;

public class IMMethodUtils {

    public static String getConversationContent(ConversationBean conversationBean){
        String content = "";
//
//        EMMessage lastMessage = conversationBean.getLastMessageContent();
//        EMMessage.Type type = lastMessage.getType();
//        String chargesListStatus = conversationBean.getChargesListStatus();
//        if (conversationBean!=null&&conversationBean.getUserInfoDataBean()!=null){
//            UserInfoBean.DataBean dataBean = conversationBean.getUserInfoDataBean();
//            if (dataBean.getChargesListStatus() == 3){
////                item.getImRecordDTO().setContent("[结束问诊]");
//                content = "[结束问诊]";
//            }
//            if (type == EMMessage.Type.CUSTOM){
//                EMCustomMessageBody body = (EMCustomMessageBody) lastMessage.getBody();
//                ALog.d("params"+body.event(), "getContent: "+body.getParams());
//                String event = body.event();
//                if (event.equals("chargesList")){
//                    content = "[问诊单]";
//                }else if (event.equals("delay_charges")) {
//                    Map<String, String> params = body.getParams();
//                    String duration = params.get("duration");
//                    content = "您为患者延长" + duration + "分钟问诊时间";
//                } else if (event.equals("patient_update_charges")) {
//                    content = "患者已修改病情信息,请点击详情查看";
//                }else if (event.equals("finish")){
//                    content = "[结束问诊]";
//                }else if (event.equals("pharmacist_audit")){
//                    content = "[系统消息]处方审核通过";
//                }else if (event.equals("setting_phone_time")) {
//                    content = "[系统消息]设置预约电话成功";
//                }else if (event.equals("miss_phone_call")) {
//                    content = "[系统消息]未接电话";
//                } else if (event.equals("phone_call_end")) {
//                    content = "[系统消息]结束通话";
//                } else if (event.equals("pharmacist_audit_fail")){
//                    content = "[系统消息]处方审核不通过请重新编辑";
//                }else if (event.equals("last_charges_template")){
//                    content = "[问诊模版结束]";
//                }else if (event.equals("cancel")){
//                    content = "[问诊已取消]";
//                }else if (event.equals("refund")){
//                    content = "[已退诊]";
//                }else if (event.equals("received")){
//                    content = "[已接诊]";
//                }else if (event.equals("to_evaluate")){
//                    content = "患者您好，请您对我的问诊服务作出评价";
//                }else if (event.equals("patient_evaluate_finish")){
//                    content = "医生您好，我已对您的服务作出评价了哦...";
//                }else if (event.equals("doctor_evaluate_thanks")){
//                    content = "感谢您对我的评价和感谢";
//                }else if (event.equals("doctor_prescribing")){
//                    content = "[系统消息]医生开方";
//                }else if (event.equals("doctor_edit_prescribing")) {
//                    content = "[系统消息]医生编辑处方";
//                }else if (event.equals("finish")){
//                    content = "[结束问诊]";
//                }else if (event.equals("doctor_prescribing")) {
//                    content = "[系统消息]处方已开具,药师正在审核中";
//                }
//            }else if (type == EMMessage.Type.IMAGE){
//                content = "[图片消息]";
//            }else if (type == EMMessage.Type.VOICE){
//                content = "[音频消息]";
//            }else if (type == EMMessage.Type.TXT){
//                EMTextMessageBody lastMessagebody = (EMTextMessageBody) lastMessage.getBody();
//                String message = lastMessagebody.getMessage();
//                char c = message.charAt(0);
////                if (message!=null && message !="" &&  c == '[' && message.charAt(message.length()-1) == ']'){
////                    content = CommonUtils.decodeUTF8(message);
////                }else{
//                    content = message;
////                    item.getImRecordDTO().setContent(); = item.getImRecordDTO().getMsgType();
////                }
//            }
//            if (dataBean.getChargesListStatus() == 7){
//                content = "[已退诊]";
//            }
//            if (dataBean.getChargesListStatus() == 5){
//                content = "[问诊单]";
//                EMCustomMessageBody body = (EMCustomMessageBody) lastMessage.getBody();
//                ALog.d("params"+body.event(), "getContent: "+body.getParams());
//                String event = body.event();
//                if (event.equals("patient_update_charges")){
//                    content = "[患者已修改病情信息,请点击查看详情]";
//                }
//            }
//            if (dataBean.getChargesListStatus() == 4){
//                content = "[未接诊取消]";
//            }
//        }else{
//            content = "[问诊单]";
//        }
//
        return content;
    }
}
